Skip to content

Conversation

@tiyash-basu-frequenz
Copy link
Contributor

This commit removes the SensorMetricSample message in favour of using MetricSample for sensors. The SensorMetricSample message was a subset of the MetricSample message.

From a design perspective focused on consistency, flexibility, and minimizing API surface area while handling variations via optional fields (which is idiomatic in Protobuf3), there's a strong argument that SensorMetricSample is redundant and potentially confusing, and that having only MetricSample is a cleaner design.

closes #339

This commit removes the `SensorMetricSample` message in favour of using
`MetricSample` for sensors. The `SensorMetricSample` message was
a subset of the `MetricSample` message.

From a design perspective focused on consistency, flexibility, and
minimizing API surface area while handling variations via optional
fields (which is idiomatic in Protobuf3), there's a strong argument that
`SensorMetricSample` is redundant and potentially confusing, and that
having only `MetricSample` is a cleaner design.

Signed-off-by: Tiyash Basu <[email protected]>
Copilot AI review requested due to automatic review settings May 22, 2025 13:41
@tiyash-basu-frequenz tiyash-basu-frequenz requested a review from a team as a code owner May 22, 2025 13:41
@github-actions github-actions bot added part:docs Affects the documentation part:protobuf Affects the protocol buffer definition files labels May 22, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the SensorMetricSample message in favor of using the MetricSample message for sensor metrics to improve consistency and reduce API surface area.

  • Replaces the SensorMetricSample type with MetricSample in the SensorData message.
  • Updates inline comments and release notes to reflect the change.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
proto/frequenz/api/common/v1/microgrid/sensors/sensors.proto Updates SensorData to use MetricSample; inline examples in comments updated.
RELEASE_NOTES.md Adds an entry to note the removal of SensorMetricSample.

Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this remove SensorMetric too?

@tiyash-basu-frequenz
Copy link
Contributor Author

Shouldn't this remove SensorMetric too?

Done.

@tiyash-basu-frequenz tiyash-basu-frequenz force-pushed the 339_sensor_metric_sample branch from 8c0e873 to 3567a48 Compare May 22, 2025 13:46
Copy link
Contributor

@llucax llucax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also wonder if it is worth clarifying that for sensors bounds will always be empty in the SensorData message, but approving as it is something very minor.

@tiyash-basu-frequenz
Copy link
Contributor Author

I also wonder if it is worth clarifying that for sensors bounds will always be empty in the SensorData message, but approving as it is something very minor.

I will remember to add it in the next PR.

@tiyash-basu-frequenz tiyash-basu-frequenz added this pull request to the merge queue May 22, 2025
Merged via the queue into frequenz-floss:v0.x.x with commit ebf585f May 22, 2025
6 checks passed
@tiyash-basu-frequenz tiyash-basu-frequenz deleted the 339_sensor_metric_sample branch May 22, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:protobuf Affects the protocol buffer definition files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove SensorMetricSample in favour of MetricSample

2 participants